﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using YAPL.Language.Core.Types;

namespace YAPL.Language.Core.Lib.GlobalFunctions {
	public class TypeName : YAPLFunction {
		private const string ARG = "arg";
		public TypeName() : base(FunctionNames.TypeName, GCL.Get(ClassNames.GlobalScope)) { }

		[Param(0, ARG)]
		public override YAPLObject Call(Scope scope) {
			ParseScope(scope);
			var arg = scope[ARG];
			
			return new YAPLString(arg.YAPLTypeName);
		}

		public override bool CanPrecompute {
			get {
				return true;
			}
		}
	}
}
